package com.hliushi.springbean;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 打印容器中的组件测试
 *
 * @author llhuang10
 * @date 2021/8/21 19:23
 */
public class AnnotationTestDemo {

    public static void main(String[] args) {
        // 这里的参数代表做操作的类TestDemo
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(TestDemo.class);

        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();

        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(beanDefinitionName);
        }

        // spring自己的组件
        // org.springframework.context.annotation.internalConfigurationAnnotationProcessor
        // org.springframework.context.annotation.internalAutowiredAnnotationProcessor
        // org.springframework.context.annotation.internalRequiredAnnotationProcessor
        // org.springframework.context.annotation.internalCommonAnnotationProcessor
        // org.springframework.context.annotation.internalPersistenceAnnotationProcessor
        // org.springframework.context.event.internalEventListenerProcessor
        // org.springframework.context.event.internalEventListenerFactory
        // testDemo
        // @Import导入的组件
        // com.hliushi.springbean.TestDemo2
        // com.hliushi.springbean.TestDemo3
        // @Bean引入的组件
        // accountDao2
    }
}
